package com.rosense.srpingboot.listener;

import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

import org.springframework.stereotype.Component;

/**
 * 
 * @author 李岩飞
 * @email eliyanfei@126.com
 * @date 2018年3月10日 下午6:11:13
 */
@WebListener
@Component
public class SessionListener implements HttpSessionListener {

	public void sessionCreated(HttpSessionEvent arg0) {
		System.out.println("---------------------创建回话------------------");
	}

	public void sessionDestroyed(HttpSessionEvent arg0) {
		HttpSession session = arg0.getSession();
		System.out.println("---------------------回话关闭------------------"+session.getId());
	}
}
